package com.kun.spring.framework.aop;

import com.kun.spring.framework.aop.support.AdvisedSupport;

/**
 * @author fangkun
 * @create 2022-06-09-14:09
 */
public class DefaultAopProxyFactory {

    public AopProxy createAopProxy(AdvisedSupport config){
        Class targetClass = config.getTargetClass();
        if(targetClass.getInterfaces().length > 0){
            return new JdkDynamicAopProxy(config);
        }
        return new CglibAopProxy();
    }
}
